package com.platform.comm.config;//package com.platform.comm.config;
//
//import com.querydsl.jpa.impl.JPAQueryFactory;
//import com.platform.comm.repository.CustomBaseRepositoryImpl;
//import com.platform.comm.util.SnowflakeIdWorker;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
//import org.springframework.data.web.config.EnableSpringDataWebSupport;
//import org.springframework.orm.jpa.JpaTransactionManager;
//import org.springframework.transaction.PlatformTransactionManager;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//
//import javax.persistence.EntityManager;
//import javax.sql.DataSource;
//
///**
// * Description: JPA Repository configuration.
// *
// * @author libin created on 2020/10/17.
// */
//@Configuration
//@EnableConfigurationProperties(IdGenProperties.class)
//@EnableJpaRepositories(basePackages = {"com.platform.**.repository"},
//        repositoryBaseClass = CustomBaseRepositoryImpl.class)
//@EnableTransactionManagement
//@EnableSpringDataWebSupport
//public class CommDaoConfig {
//
//    @Bean
//    @ConditionalOnProperty(prefix = "ncloud.cluster.id", name = {"workId", "centerId"})
//    public SnowflakeIdWorker snowflakeIdWorker(IdGenProperties idGenProperties) {
//        return new SnowflakeIdWorker(idGenProperties.getWorkId(), idGenProperties.getCenterId());
//    }
//
//    @Bean
//    @Autowired
//    public JPAQueryFactory jpaQuery(EntityManager entityManager) {
//        return new JPAQueryFactory(entityManager);
//    }
//
//}
